﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

namespace SpaceKinect.Screens
{
    class Controls:GameScreen
    {
        Texture2D keyboard;
        ContentManager content;
        /// <summary>
        /// The constructor of credit Screen
        /// </summary>
        private Controls(ScreenManager screenManage)
        {
        }
        /// <summary>
        /// Loads graphics content.
        /// </summary>
        public override void LoadContent()
        {
            if (content == null)
                content = new ContentManager(ScreenManager.Game.Services, "Content");            
        }

        /// <summary>
        /// Activates the loading screen.
        /// </summary>
        public static void Load(ScreenManager screenManager, PlayerIndexEventArgs e)
        {

            // Create and activate the loading screen.
            Controls loadingScreen = new Controls(screenManager);

            screenManager.AddScreen(loadingScreen,e.PlayerIndex);
        }

            /// <summary>
        /// Draws the loading screen.
        /// </summary>
        public override void Draw(GameTime gameTime)
        {
            keyboard = content.Load<Texture2D>("keyboard");
            SpriteBatch spriteBatch = ScreenManager.SpriteBatch;
            SpriteFont font = ScreenManager.Font;
            string title = "Controls";
            Vector2 pos = new Vector2(200, 200);
            Vector2 posTitle = new Vector2(570, 100);
            Color colour = Color.White;
            spriteBatch.Begin();
            spriteBatch.DrawString(font, title, posTitle, colour);
            spriteBatch.Draw(keyboard,pos,colour);
            spriteBatch.End();
        }



        public override void HandleInput(InputState input)
        {
            PlayerIndex playerIndex;
            if (input.IsMenuSelect(ControllingPlayer, out playerIndex))
            {
                ExitScreen();
            }
        }

    }
}
